﻿using lingopen.Application;
using lingopen.AutoMapper;
using lingopen.Entity;
using lingopen.Entity.BLE;
using lingopen.Entity.System;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace lingopen.Application.BLE
{
    public class AddOrUpdateDutyInputBase : ValidationModel
    {
        [RequiredAttribute(ErrorMessage = "名称不能为空")]
        public string Name { get; set; }
        [RequiredAttribute(ErrorMessage = "IP地址不能为空")]
        public string Code { get; set; }

        /// <summary>
        /// 端口
        /// </summary>
        //[RequiredAttribute(ErrorMessage = "端口号不能为空")]
        //public int? Port { get; set; }
        /// <summary>
        /// 排班人数
        /// </summary>
        [RequiredAttribute(ErrorMessage = "排班人数不能为空")]
        public int? DutyCount { get; set; }
        public bool IsEnabled { get; set; }
        public bool IsOnline { get; set; }
        public string Description { get; set; }
    }

    [MapToType(typeof(BLE_Duty))]
    public class AddDutyInput : AddOrUpdateDutyInputBase
    {
        public string CreateUserId { get; set; }
    }

    [MapToType(typeof(BLE_Duty))]
    public class UpdateDutyInput : AddOrUpdateDutyInputBase
    {
        [RequiredAttribute(ErrorMessage = "{0}不能为空")]
        public string Id { get; set; }
    }
}
